package com.shop.cereshop.app.dao.distributor;

import com.shop.cereshop.app.page.order.ShopDistributor;
import com.shop.cereshop.commons.domain.distributor.CereShopDistributor;
import com.shop.cereshop.commons.domain.shop.CereShopRelationship;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface CereShopDistributorDAO {
    int deleteByPrimaryKey(Long distributorId);

    int insert(CereShopDistributor record);

    int insertSelective(CereShopDistributor record);

    CereShopDistributor selectByPrimaryKey(Long distributorId);

    int updateByPrimaryKeySelective(CereShopDistributor record);

    int updateByPrimaryKey(CereShopDistributor record);

    ShopDistributor findByPhone(@Param("phone") String phone, @Param("shopId") Long shopId);

    Long findMinLevel();

    CereShopDistributor findInvitees(@Param("invitationCode") String invitationCode);

    String findInvitationCode(@Param("distributorId") Long distributorId);

    CereShopDistributor check(@Param("shopId") Long shopId, @Param("buyerUserId") Long buyerUserId);

    CereShopRelationship findRelation(@Param("shopId") Long shopId);

    CereShopDistributor selectByPhone(@Param("phone") String phone);

    ShopDistributor findById(@Param("sharerId") Long sharerId);

    CereShopDistributor findByBuyerUserId(@Param("buyerUserId") Long buyerUserId);

}